<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href='/css/styles.css' rel='stylesheet' type='text/css' />
    <link href='/images/favicon.png' rel='shortcut icon' />
    <script src='/js/jquery.min.1.4.js'></script>
    <script src='/js/app.js'></script>
    <script src='/js/common.js'></script>
    
    <meta content='width=device-width, minimum-scale=1.0, maximum-scale=1.0' name='viewport' />
    <title>redis - 命令</title>
	<meta http-equiv="description" content="redis中文资料站，下载安装redis，查找redis常用命令（commands），选择适合的redis客户端方式，配置redis主从（master-slave），阅读redis官方文档，社区里了解更多redis信息，提交redis的bug。" />
	
  </head>
  <body class=''>
    <script src='/js/head.js'></script>
    <div class='text'>
      <h1 class='command'>
        <span id='command_name_span' class='name'></span>
        <span id='command_args_span' class='arg'></span>
      </h1>
      <article>
      	<aside>
        	<script type='text/javascript'>showCmdURL();</script>
        </aside>
        
        <div class='metadata'>
          <p><strong>加入版本 <span id='command_ver_span'></span>。</strong></p>
          <p><strong>时间复杂度：</strong> O(1)。</p>
        </div>
        
        <p>Move <code>member</code> from the set at <code>source</code> to the set at <code>destination</code>. This
        operation is atomic. In every given moment the element will appear to be a
        member of <code>source</code> <strong>or</strong> <code>destination</code> for other clients.</p>
        
        <p>If the source set does not exist or does not contain the specified element, no
        operation is performed and <code>0</code> is returned. Otherwise, the element is removed
        from the source set and added to the destination set. When the specified
        element already exists in the destination set, it is only removed from the
        source set.</p>
        
        <p>An error is returned if <code>source</code> or <code>destination</code> does not hold a set value.</p>
        
        <h2>返回值</h2>
        
        <p><a href="/topics/protocol#integer-reply">Integer reply</a>, specifically:</p>
        
        <ul>
        <li><code>1</code> if the element is moved.</li>
        <li><code>0</code> if the element is not a member of <code>source</code> and no operation was performed.</li>
        </ul>
        
      
        <h2>列子</h2>
        
        <div class='example' data-session='061fe17263c082a7317bbf2bddab6f11'>
          <span class='monospace prompt'>redis>&nbsp;</span>
          <span class='monospace command'>SADD myset "one"</span>
          <pre>(integer) 1</pre>
          <span class='monospace prompt'>redis>&nbsp;</span>
          <span class='monospace command'>SADD myset "two"</span>
          <pre>(integer) 1</pre>
          <span class='monospace prompt'>redis>&nbsp;</span>
          <span class='monospace command'>SADD myotherset "three"</span>
          <pre>(integer) 1</pre>
          <span class='monospace prompt'>redis>&nbsp;</span>
          <span class='monospace command'>SMOVE myset myotherset "two"</span>
          <pre>(integer) 1</pre>
          <span class='monospace prompt'>redis>&nbsp;</span>
          <span class='monospace command'>SMEMBERS myset</span>
          <pre>1) "one"</pre>
          <span class='monospace prompt'>redis>&nbsp;</span>
          <span class='monospace command'>SMEMBERS myotherset</span>
          <pre>1) "three"&#x000A;2) "two"</pre><form>
            <span class='monospace prompt'>redis>&nbsp;</span>
            <input autocomplete='off' name='command' spellcheck='false' type='text' />
          </form></div>
        
      </article>
    </div>
    
    <script type='text/javascript'>startShow();</script>
    <div class='text' id='comments'>
      <div id='disqus_thread'></div>
      <script type='text/javascript'>
        //<![CDATA[
          var disqus_shortname = 'rediscn';
          
          // The following are highly recommended additional parameters. Remove the slashes in front to use.
          var disqus_identifier = 'command_'+curCommandObj.key;
          var disqus_url = curCommandObj.getdisqusUrl();
          
          /* * * DON'T EDIT BELOW THIS LINE * * */
          (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
              dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
              (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
          })();
        //]]>
      </script>
      <a class='dsq-brlink' href='http://disqus.com'>
        Comments powered by
        <span class='logo-disqus'>
          Disqus
        </span>
      </a>
    </div>

    
    <script src='/js/foot.js'></script>
    
  </body>
</html>
